package io.yunho.yunho.interview.two.java8.lambda;

import java.text.DecimalFormat;

/**
 * @author: Jason
 * @date: 2021/5/5 10:28
 * @description:
 */
@FunctionalInterface
interface FormartMoney{
    String formartMoney(int money);
}

class  MyMoney {
     private final int money;

    MyMoney(int money) {
        this.money = money;
    }
    void printMyMoney(FormartMoney formartMoney){
        System.out.println("我的钱："+formartMoney.formartMoney(this.money));
    }
}

public class LambdaDemo2 {
    public static void main(String[] args) {
        MyMoney myMoney = new MyMoney(999999);
        myMoney.printMyMoney(i->{
            return new DecimalFormat("#,###").format(i);
        });

    }
}
